var _common_util = require('util/common_util.js');

var _checkout_service = {
    submitCartOrder : function(resolve, reject) {
        _common_util.request({
            url     : _common_util.getServerURL('order/cart'),
            method  : "POST",
            success : resolve,
            error   : reject
        });
    },
    fakeSubmitCartOrder : function(resolve, reject) {
        _common_util.request({
            url     : _common_util.getServerURL('order/fake'),
            method  : "GET",
            success : resolve,
            error   : reject
        });
    },
    queryAlipay : function(outTradeNo, resolve, reject) {
        _common_util.request({
            url     : _common_util.getServerURL('order/query?outTradeNo=' + outTradeNo),
            method  : "GET",
            success : resolve,
            error   : reject
        });
    },
}

module.exports = _checkout_service